package com.flyfox.modules.contact;

import com.flyfox.jfinal.base.BaseModel;
import com.flyfox.jfinal.component.annotation.ModelBind;
import com.flyfox.jfinal.component.template.CRUD;
import com.flyfox.jfinal.component.template.FormType;
import com.flyfox.jfinal.component.template.InputType;
import com.flyfox.jfinal.component.template.ModelAttr;

@ModelBind(table = "tb_contact")
public class TbContact extends BaseModel<TbContact> {

	private static final long serialVersionUID = 1L;
	public static final TbContact dao = new TbContact();
	public static final CRUD crud = new CRUD();

	static {
		crud.setPrimaryKey("id");
		crud.setUrlKey("contact");
		crud.setName("联系人");
		crud.setAttr(new ModelAttr().setKey("name").setName("姓名").addSearch().setFormTypeVaild("required='required'"));
		crud.setAttr(new ModelAttr().setKey("phone").setName("手机号"));
		crud.setAttr(new ModelAttr().setKey("email").setName("Email").setInputType(InputType.EMAIL));
		crud.setAttr(new ModelAttr().setKey("addr").setName("地址").removeList());
		crud.setAttr(new ModelAttr().setKey("birthday").setName("生日").removeList().setInputType(InputType.DATE));
		crud.setAttr(new ModelAttr().setKey("remark").setName("说明").setFormType(FormType.TEXTAREA));
	}

}